/*
 * @Author: Turump 
 * @Date: 2021-04-26 09:16:26 
 * @Last Modified by: Turump
 * @Last Modified time: 2021-04-26 09:29:07
 */

import { TweenType } from "../../misc/TweenType";
import ActionBaseTask from "./ActionBaseTask";

const { ccclass, property, menu } = cc._decorator;

@ccclass
@menu("动作任务/JumpTo")
export default class JumpToTask extends ActionBaseTask {

    @property({ override: true, visible: false })
    easeType: TweenType = TweenType.linear;

    @property({ displayName: "坐标参数" })
    jumpVec: cc.Vec2 = cc.v2(0, 0);

    @property()
    height = 0;

    getAction() {
        return cc.tween(this.node)
            .parallel(
                this.getPlayAudioTween(),
                cc.jumpTo(this.actionDuration, this.jumpVec, this.height, 1))
    }

}
